<template>
  <div>
    <Sun2></Sun2>
    {{ er }}
  </div>
</template>
<script>
import Sun2 from './Sun2.vue'
export default {
  name: '',
  provide () {
    return {
      er: this.er,
      fs: this.fs
    }
  },

  components: {
    Sun2
  },
  data () {
    return {
      er: '我是儿子组件',
      fs: this.fn
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    fn (e) {
      console.log(1111111);
      //传递过来的值赋给er
      this.er = e
    }
  }
}
</script>
<style lang='less'  scoped>
</style>
